package priv.winnine.exception;

import lombok.Getter;
import priv.winnine.entity.enums.ResultEnum;

@Getter
// @Setter
public class ResultException extends RuntimeException {

    private Integer code;
    private Object data;

    public ResultException(ResultEnum result, Object data) {
        super(result.getMessage());
        this.code = result.getCode();
        this.data = data;
    }

    public ResultException(ResultEnum result) {
        super(result.getMessage());
        this.code = result.getCode();
    }

}
